﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JBeamLibrary.VehicleParts.Elements
{
    public class RefNodes
    {
        #region Properties

        public string RefNodeId { get; set; }

        public string BackNodeId { get; set; }

        public string LeftNodeId { get; set; }

        public string UpNodeId { get; set; }

        public bool IsDefined
        {
            get
            {
                return
                    !string.IsNullOrEmpty(RefNodeId) &&
                    !string.IsNullOrEmpty(BackNodeId) &&
                    !string.IsNullOrEmpty(LeftNodeId) &&
                    !string.IsNullOrEmpty(UpNodeId);
            }
        }

        #endregion

        #region CTORs

        public RefNodes()
        {
            RefNodeId = string.Empty;
            BackNodeId = string.Empty;
            LeftNodeId = string.Empty;
            UpNodeId = string.Empty;
        }

        public RefNodes(string refNode, string backNode, string leftNode, string upNode)
        {
            RefNodeId = refNode;
            BackNodeId = backNode;
            LeftNodeId = leftNode;
            UpNodeId = upNode;
        }

        #endregion

        #region Methods

        public override string ToString()
        {
            return string.Format("[ref:{0}, back:{1}, left:{2}, up:{3}]", RefNodeId, BackNodeId, LeftNodeId, UpNodeId);
        }

        #endregion
    }
}
